﻿#pragma once
#include <glm/glm.hpp>

namespace Util
{
  namespace Internal {
    static std::random_device rd;
    static std::mt19937 gen(rd());
  }

  static int RandInt(int min = 0, int max = std::numeric_limits<int>::max())
  {
    std::uniform_int_distribution<> dis(min, max);
    return dis(Internal::gen);
  }

  static uint32_t RandUInt(uint32_t min = 0, uint32_t max = std::numeric_limits<uint32_t>::max())
  {
    std::uniform_int_distribution<uint32_t> dis(min, max);
    return dis(Internal::gen);
  }

  static float RandFloat(float min = 0.0f, float max = 1.0f)
  {
    std::uniform_real_distribution<float> dis(min, max);
    return dis(Internal::gen);
  }

  static double RandDouble(double min = 0.0, double max = 1.0)
  {
    std::uniform_real_distribution<double> dis(min, max);
    return dis(Internal::gen);
  }

  static glm::vec2 RandVec2(float min = 0.0f, float max = 1.0f)
  {
    return glm::vec2(RandFloat(min, max), RandFloat(min, max));
  }

  static glm::vec3 RandVec3(float min = 0.0f, float max = 1.0f)
  {
    return glm::vec3(RandFloat(min, max), RandFloat(min, max), RandFloat(min, max));
  }

  static glm::vec4 RandVec4(float min = 0.0f, float max = 1.0f)
  {
    return glm::vec4(RandFloat(min, max), RandFloat(min, max), RandFloat(min, max), RandFloat(min, max));
  }
};